package com.yidu.hbats.service.Recovery;

import com.github.pagehelper.PageHelper;
import com.yidu.hbats.dao.AtsSchemeExpertMapper;
import com.yidu.hbats.model.AtsSchemeExpert;
import com.yidu.hbats.service.NutritionAtsScheme.NutritionAtsSchemeExpertService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @program: spring-boot-demo
 * @description: ${description}
 * @author: lr  专家咨询表的实现类
 * @create: 2019-11-27 13:34
 */

@Service
public class RecoveryAtsSchemeExpertServiceImpl implements  RecoveryAtsSchemeExpertService{

    //专家咨询表的dao
    @Resource
    AtsSchemeExpertMapper atsSchemeExpertMapper;


    /**
     * 新增
     * @param record
     * @return
     */
    @Override
    public int insertSelective(AtsSchemeExpert record) {

        return atsSchemeExpertMapper.insertSelective(record);
    }

    /**
     * 根据方案表的id查询专家咨询表
     * @param schemeId 方案表主键
     * @return
     */
    @Override
    public int selectByOne(Integer schemeId) {

        return atsSchemeExpertMapper.selectByOne(schemeId);
    }

    /**
     * 根据方案外键修改
     * @param record 传一个对象
     * @return
     */
    @Override
    public int updateByPrimaryKeySelectiveone(AtsSchemeExpert record) {
        return atsSchemeExpertMapper.updateByPrimaryKeySelectiveone(record);
    }

    /**
     * 根据方案外键修改
     * @param record 传一个对象
     * @return
     */
    @Override
    public int updateByPrimaryKeySelectiveThree(AtsSchemeExpert record) {
        return atsSchemeExpertMapper.updateByPrimaryKeySelectiveThree(record);
    }

    /**
     *
     * @param record
     * @return
     */
    @Override
    public int updateByPrimaryKeySelectiveFour(AtsSchemeExpert record) {
        return atsSchemeExpertMapper.updateByPrimaryKeySelectiveFour(record);
    }

    /**
     * 查询所有带分页
     * @param atsSchemeExpert
     * @param pageNum
     * @param pageSize
     * @return
     */


    @Override
    public List<AtsSchemeExpert> findAllSIxre(AtsSchemeExpert atsSchemeExpert, Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        return atsSchemeExpertMapper.findAllSIx(atsSchemeExpert);
    }

    /**
     * 查询总行数
     * @param atsSchemeExpert 咨询表
     * @return
     */
    @Override
    public int countSIxre(AtsSchemeExpert atsSchemeExpert) {

        return atsSchemeExpertMapper.countSIx(atsSchemeExpert);
    }

    /**
     *
     * @param expertId
     * @return
     */
    @Override
    public List<AtsSchemeExpert> selectByPrimaryKeyThree(String expertId) {
        return atsSchemeExpertMapper.selectByPrimaryKeyThree(expertId);
    }

    /**
     *
     * @param seId
     * @return
     */
    @Override
    public AtsSchemeExpert selectByPrimaryKeyFour(int seId) {
        return atsSchemeExpertMapper.selectByPrimaryKeyFour(seId);
    }

    /**
     *
     * @param record
     * @return
     */
    @Override
    public int updateByPrimaryKeySelective(AtsSchemeExpert record) {
        return atsSchemeExpertMapper.updateByPrimaryKeySelective(record);
    }

    /**
     *
     * @param schemeId
     * @return
     */
    @Override
    public AtsSchemeExpert selectByPrimaryKeyFive(int schemeId) {
        return atsSchemeExpertMapper.selectByPrimaryKeyFive(schemeId);
    }

    /**
     * 根据外键id查询所有
     * @param schemeId 方案表主键
     * @return
     */
    @Override
    public AtsSchemeExpert selectBySix(Integer schemeId) {
        return atsSchemeExpertMapper.selectBySix(schemeId);
    }
}

